<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="redis" uri="http://www.shopjsp.com/redisTag/functions" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="basePath" value="${redis:getSysConfig('base_path_back')}"/>
<script type="text/javascript">
    /**
     * 查看发票信息
     */
	<shiro:hasPermission name="back_gotoCustomerPage_invoice">
    function invoiceInfo(){
        /**获取选中行的id**/
        var selectedRow = $("#tt").bootstrapTable('getSelections');
        if (selectedRow.length == 1) {
            $("#btn_invoice").attr("data-target", "#invoiceInfoModal");/**选中了记录后才可打开对应的模态框**/
            $.ajax({
                type: "POST",
                dataType: "JSON",
                url: "${basePath}/back/customer/findInvoiceInfo.sjson",
                data: {customerId: selectedRow[0].customerId},
                success: function (result) {
                    var data = JSON.parse(result.data);
                    /**重置详情页中所有html展示信息**/
                    resetDetailTable("detailTableInvoice");
                    /**设置展示信息**/
                    $("#d_invoiceTitle").html(data.invoiceTitle);/**发票抬头**/
                    $("#d_invoiceInfo").html(data.invoiceInfo);/**发票内容**/
                    $("#d_companyName").html(data.companyName);/**单位名称**/
                    $("#d_taxpayerIdentificationCode").html(data.taxpayerIdentificationCode);/**纳税人识别编号**/
                    $("#d_registerAddress").html(data.registerAddress);/**注册地址**/
                    $("#d_registerPhone").html(data.registerPhone);/**注册电话**/
                    $("#d_depositBank").html(data.depositBank);/**开户行**/
                    $("#d_bankAccount").html(data.bankAccount);/**账号**/
                }
            });
        } else {
            $("#btn_invoice").attr("data-target", "");/**没有选中记录不可打开模态框**/
            showMsg("请选择一行记录！");
        }
    }
	</shiro:hasPermission>
</script>

<!--详情模态框（Modal） -->
<div class="modal fade" id="invoiceInfoModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width:70%">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<h5 class="modal-title" id="myModalLabel">会员发票信息</h5>
			</div>
			<div class="modal-body">
				<table id="detailTableInvoice" align="center" class="addOrEditTable table table-bordered" style="width:100%;">
					<tr class="titlebg"><td align="center" colspan="2">个人普通发票</td></tr>
					<tr>
						<td class="toright_td" width="150px">发票抬头:</td>
						<td class="toleft_td" >&nbsp;&nbsp;<span id="d_invoiceTitle"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">发票内容:</td>
						<td class="toleft_td" >&nbsp;&nbsp;<span id="d_invoiceInfo"></span></td>
					</tr>
					<tr class="titlebg"><td align="center" colspan="2">增值税发票</td></tr>
					<tr>
						<td class="toright_td" width="150px">单位名称:</td>
						<td class="toleft_td" >&nbsp;&nbsp;<span id="d_companyName"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">纳税人识别编号:</td>
						<td class="toleft_td" >&nbsp;&nbsp;<span id="d_taxpayerIdentificationCode"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">注册地址:</td>
						<td class="toleft_td" >&nbsp;&nbsp;<span id="d_registerAddress"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">注册电话:</td>
						<td class="toleft_td" >&nbsp;&nbsp;<span id="d_registerPhone"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">开户行:</td>
						<td class="toleft_td" >&nbsp;&nbsp;<span id="d_depositBank"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">账号:</td>
						<td class="toleft_td" >&nbsp;&nbsp;<span id="d_bankAccount"></span></td>
					</tr>
				</table>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal -->
</div>